(function (window, undefined) {
    let t = null
    $.fn.loding = function () {
        let _this=this
        function loding() {
            if (t) clearTimeout(t)
            t = setTimeout(() => {
                let windowH = window.innerHeight || document.documentElement.clientHeight
                let scrollH = document.body.scrollTop || document.documentElement.scrollTop
                let showH = windowH + scrollH
                let imgs =  _this
                for (let i = 0; i < imgs.length; i++) {
                    if (imgs[i].offsetTop < showH) {
                        imgs[i].src = imgs[i].getAttribute('data-src')
                    }
                }
            }, 200)
        }
        loding()
        window.onscroll = loding
    }
})(window)